/**
 * hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
 * redirect: noredirect           if `redirect:noredirect` will no redirct in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    permission: ['xx.p1','xx.p2'] will control the page permission (you can set multiple permission)
    title: 'title'                the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'              the icon show in the sidebar,
    keepAlive: false              if false ,the page will no be cached(default is false)
  }
 */

export const constantRouterMap = [
  { path: '/401', component: () => import('@/views/errorPage/401.vue'), hidden: true },
  { path: '/404', component: () => import('@/views/errorPage/404.vue'), hidden: true },

  {
    path: '',
    component: 'Layout',
    redirect: '/index',
    name: 'Home',
    meta: { title: '首页', icon: 'zujian' },
    children: [
      {
        path: 'index',
        name: 'HomePage',
        component: () => import('@/views/index.vue'),
        meta: { title: '首页', icon: 'zujian' },
      },
    ],
  },
];

export const asyncRouterMap = [
  {
    path: '/author',
    component: 'Layout',
    redirect: '/author/list',
    name: 'Author',
    meta: { title: '用户', icon: 'zujian', permission: ['wms:gitlab:author'] },
    children: [
      {
        path: 'list',
        name: 'AuthorList',
        component: () => import('@/views/author/list'),
        meta: { title: '用户列表', icon: 'zujian' },
      },
    ],
  },

  { path: '*', redirect: '/404', hidden: true },
];
